
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1, maximum-scale=1">
    <meta id="theme-color" name="theme-color" content="#ffffff">
    <title>Audio stream volume</title>
    <!-- <link rel="stylesheet" href="../../../css/main.css"/> -->
    <link rel="stylesheet" href="./volume.css"/>
</head>
<body>
<div id="container">
    <p>Measure the volume of a local media stream using WebAudio.</p>
    <div id="meters">
        <div id="instant">
            <div class="label">Instant:</div>
            <meter high="0.25" max="1" value="0"></meter>
            <div class="value"></div>
        </div>
        <div id="slow">
            <div class="label">Slow:</div>
            <meter high="0.25" max="1" value="0"></meter>
            <div class="value"></div>
        </div>
        <div id="clip">
            <div class="label">Clip:</div>
            <meter max="1" value="0"></meter>
            <div class="value"></div>
        </div>
    </div>

    <div>
        <button type="button" id="startButton">Start</button> 
        <button type="button" id="stopButton" disabled>Stop</button>
    <div>

    <p>The 'instant' volume changes approximately every 50ms; the 'slow' volume approximates the average volume over
        about a second.</p>
    <p>Note that you will not hear your own voice; use the local audio rendering demo for that.
    </p>
    <p>The <code>audioContext</code>, <code>stream</code> and <code>soundMeter</code> variables are in global scope, so
        you can inspect them from the console.</p>

</div>


<script src="./soundmeter.js"></script>
<script src="./volume.js" async></script>

</body>
</html>
